\(\int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx\) [799]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 45 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a \sec (c+d x)}{d}+\frac {a \sec ^3(c+d x)}{3 d}+\frac {a \tan ^3(c+d x)}{3 d} \]

[Out]

-a*sec(d*x+c)/d+1/3*a*sec(d*x+c)^3/d+1/3*a*tan(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2917, 2687, 30, 2686} \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=\frac {a \tan ^3(c+d x)}{3 d}+\frac {a \sec ^3(c+d x)}{3 d}-\frac {a \sec (c+d x)}{d} \]

[In]

Int[Sec[c + d*x]^2*(a + a*Sin[c + d*x])*Tan[c + d*x]^2,x]

[Out]

-((a*Sec[c + d*x])/d) + (a*Sec[c + d*x]^3)/(3*d) + (a*Tan[c + d*x]^3)/(3*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2917

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rubi steps \begin{align*} \text {integral}& = a \int \sec ^2(c+d x) \tan ^2(c+d x) \, dx+a \int \sec (c+d x) \tan ^3(c+d x) \, dx \\ & = \frac {a \text {Subst}\left (\int x^2 \, dx,x,\tan (c+d x)\right )}{d}+\frac {a \text {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\sec (c+d x)\right )}{d} \\ & = -\frac {a \sec (c+d x)}{d}+\frac {a \sec ^3(c+d x)}{3 d}+\frac {a \tan ^3(c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a \sec (c+d x)}{d}+\frac {a \sec ^3(c+d x)}{3 d}+\frac {a \tan ^3(c+d x)}{3 d} \]

[In]

Integrate[Sec[c + d*x]^2*(a + a*Sin[c + d*x])*Tan[c + d*x]^2,x]

[Out]

-((a*Sec[c + d*x])/d) + (a*Sec[c + d*x]^3)/(3*d) + (a*Tan[c + d*x]^3)/(3*d)

Maple [A] (verified)

Time = 0.15 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.02

method result size
parallelrisch \(\frac {4 a \left (1-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}\) \(46\)
risch \(-\frac {2 \left (-3 i a \,{\mathrm e}^{2 i \left (d x +c \right )}-a \,{\mathrm e}^{i \left (d x +c \right )}+3 a \,{\mathrm e}^{3 i \left (d x +c \right )}-i a \right )}{3 \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) d}\) \(76\)
derivativedivides \(\frac {a \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+\frac {a \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}}{d}\) \(82\)
default \(\frac {a \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+\frac {a \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}}{d}\) \(82\)
norman \(\frac {\frac {4 a}{3 d}-\frac {8 a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {8 a \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {8 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\) \(107\)

[In]

int(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

4/3*a*(1-2*tan(1/2*d*x+1/2*c))/d/(tan(1/2*d*x+1/2*c)+1)/(tan(1/2*d*x+1/2*c)-1)^3

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.09 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=\frac {a \cos \left (d x + c\right )^{2} - 2 \, a \sin \left (d x + c\right ) + a}{3 \, {\left (d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - d \cos \left (d x + c\right )\right )}} \]

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/3*(a*cos(d*x + c)^2 - 2*a*sin(d*x + c) + a)/(d*cos(d*x + c)*sin(d*x + c) - d*cos(d*x + c))

Sympy [F]

\[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=a \left (\int \sin ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int \sin ^{3}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]

[In]

integrate(sec(d*x+c)**4*sin(d*x+c)**2*(a+a*sin(d*x+c)),x)

[Out]

a*(Integral(sin(c + d*x)**2*sec(c + d*x)**4, x) + Integral(sin(c + d*x)**3*sec(c + d*x)**4, x))

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.87 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=\frac {a \tan \left (d x + c\right )^{3} - \frac {{\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} a}{\cos \left (d x + c\right )^{3}}}{3 \, d} \]

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/3*(a*tan(d*x + c)^3 - (3*cos(d*x + c)^2 - 1)*a/cos(d*x + c)^3)/d

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.49 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {\frac {3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1} - \frac {3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, a}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}}}{6 \, d} \]

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/6*(3*a/(tan(1/2*d*x + 1/2*c) + 1) - (3*a*tan(1/2*d*x + 1/2*c)^2 - 12*a*tan(1/2*d*x + 1/2*c) + 5*a)/(tan(1/2
*d*x + 1/2*c) - 1)^3)/d

Mupad [B] (verification not implemented)

Time = 10.00 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.64 \[ \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx=-\frac {4\,a\,\left ({\sin \left (c+d\,x\right )}^2+2\,\sin \left (c+d\,x\right )+4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\sin \left (2\,c+2\,d\,x\right )-4\right )}{3\,d\,\left (8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,\sin \left (2\,c+2\,d\,x\right )-4\right )} \]

[In]

int((sin(c + d*x)^2*(a + a*sin(c + d*x)))/cos(c + d*x)^4,x)

[Out]

-(4*a*(2*sin(c + d*x) + sin(2*c + 2*d*x) + 4*sin(c/2 + (d*x)/2)^2 + sin(c + d*x)^2 - 4))/(3*d*(2*sin(2*c + 2*d
*x) + 8*sin(c/2 + (d*x)/2)^2 - 4))